<!--
 * @Description: file content
 * @Author: oooh
 * @Date: 2024-04-27 17:20:26
 * @LastEditors: oooh
 * @LastEditTime: 2024-08-07 16:28:21
 * @FilePath: \Civil_Servant_Performance_PC\src\views\performance-inventory\civil\democratic-evaluation.vue
-->
<template>
  <div class="component-container">
    <div class="flex-table">
      <el-table :data="tableList" border style="width: 100%" height="100%" v-loading="tableLoading">
        <el-table-column label="序号" type="index" align="center">
          <template slot-scope="scope">
            <span>{{ scope.$index + 1 }}</span>
          </template>
        </el-table-column>
        <el-table-column label="站办所" prop="deptName" align="center"></el-table-column>
        <el-table-column prop="civilServantName" label="评分对象" min-width="160" align="center" show-overflow-tooltip> </el-table-column>
        <el-table-column label="得分" prop="score" align="center"></el-table-column>
        <el-table-column label="备注" prop="remarks" align="center"></el-table-column>
      </el-table>
    </div>
    <pagination
      v-show="tableTotal > 0"
      :total="tableTotal"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import { list } from '@/api/work/democratic-evaluation'

export default {
  name: 'performance-inventory_dept_democratic-evaluation',
  dicts: [],
  props: {
    queryForm: {
      type: Object,
      default: () => {}
    }
  },
  components: {},
  data() {
    return {
      tableTotal: 0,
      tableList: [],
      tableLoading: false,
      queryParams: {
        pageNum: 1,
        pageSize: 20
      }
    }
  },
  computed: {},
  watch: {
    queryForm: {
      deep: true,
      immediate: true,
      handler(query) {
        this.queryParams = { ...this.queryParams, ...query }
        this.getList()
      }
    }
  },
  methods: {
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1
      this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm('queryForm')
      this.queryParams.pageNum = 1
      this.handleQuery()
    },
    // 工作列表
    getList() {
      this.tableLoading = true
      list(this.queryParams)
        .then(res => {
          this.tableTotal = res.total
          this.tableLoading = false
          let { rows } = res
          this.tableList = rows
        })
        .catch(err => (this.tableLoading = false))
    }
  }
}
</script>

<style lang="scss"></style>
